{include file="public/nheader"}
<div class="layui-fluid layui-bg-white">
    <form action="{:url()}" class="layui-form layui-form-fixed">
        <div class="layui-form-item">
            <label class="layui-form-label">
                <font color="red">* </font>类目名称(为便于管理，类目一但添加不可删除)
            </label>
            <div class="layui-input-block">
                <input type="text" id="leimu" name="leimu" required="" lay-verify="required" autocomplete="off"
                    class="layui-input">
            </div>
        </div>
        <div class="layui-footer layui-form-item layui-center ">
            <button class="layui-btn" lay-filter="submitIframe" type="button" lay-submit>添加</button>
            <button class="layui-btn layui-btn-primary" type="button" sa-event="closeDialog">取消</button>
        </div>
    </form>
</div>
{include file="public/nfooter"}
<script>
    layui.use(['form', 'layer'], function () {
        $ = layui.jquery;
        var form = layui.form
            , layer = layui.layer;
        form.on('switch(kags)', function (data) {
            var value = data.value;
            console.log(value, data);
            return false;
        });
        form.on('checkbox(father)', function (data) {
            if (data.elem.checked) {
                $(data.elem).parent().next('div').find('input').prop("checked", true);
                form.render();
            } else {
                $(data.elem).parent().next('div').find('input').prop("checked", false);
                form.render();
            }
        });
    });
</script>